---
id: 65824dfdb6815d563b2d3256
title: Step 28
challengeType: 20
dashedName: step-28
---

# --description--

The `input()` function takes a user input and it returns the user input in the form of a string.

Inside your `while` loop, call the `input()` function passing the string `'Enter your choice: '` as the argument, and assign the result to a variable named `choice`.

# --hints--

You should have `choice = input('Enter your choice: ')` in your `while` loop.

```js
({ test: () =>
  {
    const transformedCode = code.replace(/\r/g, "");        
    const foo = __helpers.python.getDef("\n"+transformedCode, "main");
    const {function_body} = foo;    
    assert(function_body.match(/^\s+choice\s*=\s*input\s*\(\s*("|')Enter\syour\schoice:\s\1\s*\)/m));
  }
})
```

# --seed--

## --seed-contents--

```py
def add_expense(expenses, amount, category):
    expenses.append({'amount': amount, 'category': category})
    
def print_expenses(expenses):
    for expense in expenses:
        print(f'Amount: {expense["amount"]}, Category: {expense["category"]}')
    
def total_expenses(expenses):
    return sum(map(lambda expense: expense['amount'], expenses))
    
def filter_expenses_by_category(expenses, category):
    return filter(lambda expense: expense['category'] == category, expenses)
    
--fcc-editable-region--
def main():
    expenses = []
    while True:
        print('\nExpense Tracker')
        print('1. Add an expense')
        print('2. List all expenses')
        print('3. Show total expenses')
        print('4. Filter expenses by category')
        print('5. Exit')
        
--fcc-editable-region--
```
